/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ejemplo.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author carlosdavid
 */
@Entity
@Table(name = "operacion", catalog = "base_produccion", schema = "")
@NamedQueries({
    @NamedQuery(name = "Operacion.findAll", query = "SELECT o FROM Operacion o"),
    @NamedQuery(name = "Operacion.findByCodoperacion", query = "SELECT o FROM Operacion o WHERE o.codoperacion = :codoperacion"),
    @NamedQuery(name = "Operacion.findByDescripcion", query = "SELECT o FROM Operacion o WHERE o.descripcion = :descripcion")})
public class Operacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "codoperacion", nullable = false, length = 2)
    private String codoperacion;
    @Basic(optional = false)
    @Column(name = "descripcion", nullable = false, length = 100)
    private String descripcion;

    public Operacion() {
    }

    public Operacion(String codoperacion) {
        this.codoperacion = codoperacion;
    }

    public Operacion(String codoperacion, String descripcion) {
        this.codoperacion = codoperacion;
        this.descripcion = descripcion;
    }

    public String getCodoperacion() {
        return codoperacion;
    }

    public void setCodoperacion(String codoperacion) {
        this.codoperacion = codoperacion;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codoperacion != null ? codoperacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Operacion)) {
            return false;
        }
        Operacion other = (Operacion) object;
        if ((this.codoperacion == null && other.codoperacion != null) || (this.codoperacion != null && !this.codoperacion.equals(other.codoperacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ejemplo.entity.Operacion[ codoperacion=" + codoperacion + " ]";
    }
    
}
